/*
 * Copyright 2020-2021 redragon.dongbin
 *
 * This file is part of redragon-erp/赤龙ERP.

 * redragon-erp/赤龙ERP is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.

 * redragon-erp/赤龙ERP is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with redragon-erp/赤龙ERP.  If not, see <https://www.gnu.org/licenses/>.
 */
package com.erp.inv.input.dao.model;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import com.erp.masterdata.common.model.BaseModel;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Data
@MappedSuperclass
public class InvInputHeadBase extends BaseModel {

    //Constructors
    public InvInputHeadBase() {
    }
    
    //Fields
    
    //主键
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "input_head_id", unique = true, nullable = false)
    private Integer inputHeadId;
    
    //入库单编码
//    @NotBlank(message="入库单编码不能为空")
    @Column(name = "input_head_code", unique = true, nullable = false, length = 45)
    private String inputHeadCode;

    //入库类型（采购入库PO_IN、销售退回SO_RETURN、盘点入库CHECK_IN）
//    @NotBlank(message="入库单类型不能为空")
    @Column(name = "input_type", unique = false, nullable = false, length = 45)
    private String inputType;

    //入库来源类型（采购订单PO）
    //@NotBlank(message="数据来源不能为空")
    @Column(name = "input_source_type", unique = false, nullable = false, length = 45)
    private String inputSourceType;

    //入库来源头编码（采购订单头编码）
    //@NotBlank(message="来源单据编码不能为空")
    @Column(name = "input_source_head_code", unique = false, nullable = false, length = 45)
    private String inputSourceHeadCode;

    //仓库编码
//    @NotBlank(message="仓库选择不能为空")
    @Column(name = "warehouse_code", unique = false, nullable = false, length = 45)
    private String warehouseCode;

    //入库日期
//    @NotNull(message="入库日期不能为空")
    @Column(name = "input_date", unique = false, nullable = false)
    private Date inputDate;

    //备注
    @Column(name = "memo", unique = false, nullable = true, length = 200)
    private String memo;

    //版本
    @Column(name = "version", unique = false, nullable = false)
    private Integer version;

    //状态（新建NEW，确认CONFIRM，变更ALTER，取消CANCEL）
    @Column(name = "status", unique = false, nullable = false, length = 10)
    private String status;

    //审批状态（未提交UNSUBMIT、已提交SUBMIT、已审批APPROVE、已驳回REJECT）
    @Column(name = "approve_status", unique = false, nullable = false, length = 10)
    private String approveStatus;

    //制单人
//    @NotBlank(message="制单人不能为空")
    @Column(name = "staff_code", unique = false, nullable = false, length = 45)
    private String staffCode;

    //制单部门
//    @NotBlank(message="制单部门不能为空")
    @Column(name = "department_code", unique = false, nullable = false, length = 45)
    private String departmentCode;


    //组织机构
    @Column(name = "org_code", unique = false, nullable = false, length = 10)
    private String orgCode;

    @Column(name = "file", unique = false, nullable = false, length = 255)
    private String file;


    @Column(name = "input_manner", unique = false, nullable = false, length = 2)
    private String inputManner;

    @Column(name = "is_testing", unique = false, nullable = false, length = 2)
    private String isTesting;

    @Column(name = "testing_file", unique = false, nullable = false, length = 255)
    private String testingFile;

    @Column(name = "attribute1", unique = false, nullable = true, length = 45)
    private String attribute1;

    @Column(name = "attribute2", unique = false, nullable = true, length = 45)
    private String attribute2;

    @Column(name = "attribute3", unique = false, nullable = true, length = 45)
    private String attribute3;

    @Column(name = "attribute4", unique = false, nullable = true, length = 45)
    private String attribute4;

    @Column(name = "attribute5", unique = false, nullable = true, length = 45)
    private String attribute5;

    @Column(name = "attribute6", unique = false, nullable = true, length = 45)
    private String attribute6;

    @Column(name = "attribute7", unique = false, nullable = true, length = 45)
    private String attribute7;
    
    @Column(name = "attribute8", unique = false, nullable = true, length = 45)
    private String attribute8;

    @Column(name = "attribute9", unique = false, nullable = true, length = 45)
    private String attribute9;

    @Column(name = "attribute10", unique = false, nullable = true, length = 45)
    private String attribute10;

    //显示字段
    @Transient
    private String staffName;
    @Transient
    private String departmentName;
    @Transient
    private String warehouseAddress;
    @Transient
    private String inputSourceHeadName;
    @Transient
    private String vendorName;
    @Transient
    private String vendorContactDesc;

    private Integer is_bill;


}